/*
 * @描述: 
 * @创建者: kilomChou
 * @Date: 2021-04-11 22:09:18
 * @最后编辑: kilomChou
 * @LastEditTime: 2021-05-06 12:52:21
 */

import { ClientEventDef, ED } from "../event/ClientEvent";

/** model基类 */
export default abstract class BaseModel {

    constructor() {
        this.listenProto();
    }

    /** 监听协议 */
    abstract listenProto(): void

    /** 发送事件 */
    sendEvent<Event extends keyof ClientEventDef>(event: Event, data?: ClientEventDef[Event]) {
        ED.send(event, data);
    }

}